package thread.src.api;

public class MyThread extends Thread{
    public MyThread() {
    }
//通过重写构造器直接初始化线程名
    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(Thread.currentThread().getName() + "输出:" + i);
        }
    }
}
